import type { Effect,Reducer } from 'umi';
import { login } from './service';
import type { DataInfoType } from './data.d';

export type ModelType = {
  namespace: string;
  state: DataInfoType;
  effects: {
    login: Effect;
  };
  reducers: {
  };
};

const Model: ModelType = {
  namespace: 'indexPage',

  state: {
    loginInfo: {
      userName: '',
      password: '',
    },
    loginResult: {},
  },
  effects: {
      *login({ playload }, { call, put }){
        const result = yield call(login, playload);
        return result;
      }
  },
  reducers: {

  },
};

export default Model;
